<template>
	<div>
		<section class="top-public" ref="navBg">
			<span @click="gotoAddress" class="leftIcon">
				<mu-icon :size="32"   value="keyboard_arrow_left"    />
			</span>
			
			<section style="flex:8;"></section>
			<span class="top-public-title">{{title}}</span>
<!--			<a href="sms:12345678901?body=cxye">发送短信</a>-->
			<!--<span v-show="!rightShow" style="flex: 2;"></span>
			<span v-show="rightShow" @click="rightDo()" class="rightBtn" >{{btnName}}</span>-->
			<span style="flex: 1.4;"></span>
		</section>
	</div>
</template>

<script>
	export default {
	data() {
      return {
      		
      	}
     },
    props: {
      title:{
      	type:String,
      	default:''
      },
      bgColor:{
      	type:String,
      	default:'#ccc'
      },
      returnPath:{
      	type: String,
        default: ""
      },
//    path:{
//    	type:Object,
//    	default: {}
//    }
	},
	mounted(){
		console.log(this.bgColor)
		this.$refs.navBg.style.backgroundColor=this.bgColor
	},
	methods:{
		gotoAddress(){
			var that=this
			if(that.returnPath=='上一级'){
				that.$router.go(-1)
			}else{
				that.$router.push({
					path:that.returnPath
				})
			}
			
		},
		rightDo(){
			var that=this
			this.$emit('fatherDo',this.btnName)
		},
	}
 }
	
	
	
</script>

<style scoped>
.top-public{
	/*background: red;*/
	position: fixed;
	left: 0;
	top: 0;
	display: flex;
	justify-content: center;
	align-items: center;
	z-index: 11;
	height: 3rem;
	width: 100%;
	border-bottom: 1px solid #e5e5e5;
	/*border-bottom: 2px solid deepskyblue;*/
 }
 .top-public-title{
 	font-size: 1.1rem;
 	position: absolute;
 	left: 35%;
 	top: 0;
 	width: 30%;
 	height: 100%;
 	display: flex;
 	justify-content: center;
	align-items: center;
 }
 .leftIcon{
 	flex: 1.4;
 	display: flex;
 	justify-content: center;
 	align-items: center;
 	/*text-indent: -1rem;*/
 }
 .rightBtn{
 	flex: 3;
 	text-align: right;
 	font-size:1rem;
 	padding-right: 0.8rem;
 }
</style>